package com.sctvcloud.renhe.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.renhe.R;
import com.sctvcloud.renhe.beans.NewsItem;
import com.sctvcloud.renhe.ui.adapter.holder.HomeHotVideoContentHolder;
import com.sctvcloud.renhe.ui.adapter.holder.News24Holder;

import java.util.List;

public class HomeTopNewsListAdapter extends BaseHolderAbsAdapter<NewsItem, News24Holder> {
    public HomeTopNewsListAdapter(Context context, List<NewsItem> list) {
        super(context, list);
    }

    @Override
    public News24Holder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_news_24_cl, parent, false);
        News24Holder homeNewsHolder = new News24Holder(context, view);
        homeNewsHolder.setInternalClick(this);

        return homeNewsHolder;
    }

    @Override
    public HomeTopNewsListAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }

    @Override
    public void onBindViewHolder(News24Holder holder, int position) {
        //  holder.setOnly(getItemCount()==1);
        super.onBindViewHolder(holder, position);
    }
}

